package com.eiisan.user.web.controller;

import com.eiisan.core.util.api.Result;
import com.eiisan.user.model.dto.UserLoginDto;
import com.eiisan.user.service.LoginService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 用户登录控制器
 * @Author: gragonfly
 * @Date: 2019/6/25
 */
@RestController
@RequestMapping("/login")
@Api(tags = "WEB - 用户登录控制器")
public class LoginController {

    @Autowired
    private LoginService loginService;


    @PostMapping(value = "/auth", name = "登录接口")
    @ApiOperation(value = "登录接口")
    public Result<String> login(@RequestBody UserLoginDto userLoginDto) {
        return loginService.login(userLoginDto);
    }
}
